
<div class="page-search-bar">
  <div class="widget-header">
    <div class="align-left">
      <%= simple_form_for(partners_path, :method => 'get') do |f| %>
        <select name="partner[partner_category_id]" class="input-xs" placeholder="往来单位类别">
          <option value=""></option>
          <% PartnerCategory.all.each do |partner|%>
            <option value="<%= partner.id%>"><%= partner.name%></option>
          <% end %>
        </select>
        <div class="widget-buttons buttons-bordered">
          <input class="btn btn-blue btn-xs" name="commit" type="submit" value="搜索">
        </div>
      <% end %>
    </div>
  </div>
</div>

<div class="row">
  <div class="col-xs-12 col-md-12">

    <div class="widget">

      <div class="widget-header bordered-bottom bordered-themeprimary">
        <i class="widget-icon fa fa-tasks themeprimary"></i>
        <span class="widget-caption themeprimary"><%=@page_title %></span>
        <div class="widget-buttons buttons-bordered">
          <%= button_to '新建客户单位', new_customer_path, method: :get, :class => "btn btn-blue btn-xs" %>
        </div>
        <div class="widget-buttons buttons-bordered">
          <%= button_to '新建供应商单位', new_supplier_path, method: :get,  :class => "btn btn-blue btn-xs" %>
        </div>
        

      </div><!--Widget Header-->
      <div class="widget-body">
        <div class="widget-main no-padding">
          <%= render 'layouts/flash_messages' %>

          <div class="table-scrollable">
            <div class="dataTables_wrapper form-inline no-footer">
              <table class="table table-bordered table-striped table-condensed flip-content">
                <thead class="flip-content bordered-palegreen">
                <tr>
                  <th>往来单位类别</th>
                  <th>往来单位编码</th>
                  <th>往来单位名称</th>
                  <th>简称</th>
                  <th>性质</th>

                  <th>结算客户</th>
                  <th>分管部门</th>
                  <th>分管人员</th>
                  <th>地址</th>
                  <th>电话</th>
                  <th>传真</th>

                  <th colspan="3"></th>
                </tr>
                </thead>

                <tbody>
                <% @partners.each do |partner| %>
                  <tr>
                    <td><%= partner.partner_category.name %></td>
                    <td><%= partner.code %></td>
                    <td><%= partner.name %></td>
                    <td><%= partner.shortname %></td>
                    <td><%= partner.partner_type %></td>
                    <td><%= Partner.find(partner.payable_partner_id).name if partner.payable_partner_id.present? %></td>
                    <td><%= partner.deputy_depart_id %></td>
                    <td><%= partner.sales_id %></td>
                    <td><%= partner.address %></td>
                    <td><%= partner.tel %></td>
                    <td><%= partner.fax %></td>

                    <td><%= link_to image_tag('show.png'), partner %>
                    <%= link_to image_tag('trash.gif'), partner, method: :delete, data: { confirm: 'Are you sure?' } %></td>
                  </tr>
                <% end %>
                </tbody>
              </table>


              </table>
              <div class="row DTTTFooter">
                <div class="col-xs-12 col-md-12">
                  <div class="dataTables_paginate paging_bootstrap" id="simpledatatable_paginate">
                    <%= paginate @partners, window: 1, outer_window: 1, remote: true %>
                  </div>
                </div>
              </div>

            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
